/**
 * Created by 2019/3/11/011
 * Author: Admin
 */
import React, {Component} from 'react';
import { HashRouter, BrowserRouter as Router, Route, Switch, Redirect} from 'react-router-dom';
import App from  '../App'
import Home from '../components/home/Home'
import Detail from '../components/detail/Detail'
import login from '../components/login/login'
import Sign from '../components/sign/sign';
import menu from '../components/menu/menu';
import employee from '../components/table/employee'
import record from '../components/table/record'
import checkIn from '../components/table/checkIn'
import evaluate from '../components/table/evaluate'
import redeploy from '../components/table/redeploy'
import salary from '../components/table/salary'
import set from '../components/set/set'
import explain from '../components/explain/explain'

// React.render((
//     <Router>
//         <Route path="/" component={App}>
//             <Route path="Home" component={Home} />
//             <Route path="Detail/:id" component={Detail}>
//                 {/*<Route path="messages/:id" component={Message} />*/}
//             </Route>
//         </Route>
//     </Router>
// ), document.body)
export default class Routers extends Component{
    render(){
        return(
            <Router>
                <Switch>
                    <Route exact path="/" component={login}/>

                    <Route path="/menu" component={menu}>
                        <Route path="home"  component={Home}>
                        </Route>
                        <Route path="/Detail/:id" component={Detail}/>
                        <Route path="employee" component={employee} >
                            <Route path="record" component={record}/>
                            <Route path="checkIn" component={checkIn}/>
                            <Route path="evaluate" component={evaluate}/>
                            <Route path="redeploy" component={redeploy}/>
                            <Route path="salary" component={salary}/>
                        </Route>
                        <Route path="set" component={set}/>
                        <Route path="explain" component={explain}/>
                    </Route>

                    <Route render={() => <h1>404, not found</h1>} />
                     {/*render={() =>*/}
                     {/*<Redirect  to='/'  ></Redirect>*/}
                        {/*}*/}
                    {/*// <Redirect from="/" to='/login'  ></Redirect>*/}
                </Switch>
            </Router>

        )
    }
}
